package edu.hawaii.duedates.web.page.display;

import org.apache.wicket.util.tester.FormTester;
import org.apache.wicket.util.tester.WicketTester;
import org.junit.Ignore;
import org.junit.Test;
import edu.hawaii.duedates.web.DueDatesTestApplication;
import edu.hawaii.duedates.web.page.index.Index;

/**
 * Tests the display page.
 * 
 * @author Vincent Leung and Creighton Okada.
 */

public class TestDisplay {
  
  /**
   * Tests the index page.
   */
  @Test
  @Ignore
  public void testDisplay() {
    WicketTester tester = new WicketTester(new DueDatesTestApplication());
    tester.startPage(Index.class);
    tester.assertRenderedPage(Index.class);

    tester.assertContains("Welcome");
    
    FormTester formTester = tester.newFormTester("wuxDueDatesForm");
    formTester.setValue("wuxUserId", "test1@hawaii.edu");
    formTester.setValue("wuxPassword", "test1now");
    formTester.submit("wuxLogin");
    
    tester.assertRenderedPage(Display.class);
  }
}